/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package backs;

import db.NWDB;
import java.util.ArrayList;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;

/**
 *
 * @author gjun
 */
public class ProductModifyProcess {
    
    private String id;
    
    public ProductModifyProcess() {
    }
    
    public String execute() throws Exception {
        
        NWDB db = new NWDB();
        ArrayList<HashMap<String,Object>> result= db.getInfoToBack(id);
        
        HttpServletRequest request=ServletActionContext.getRequest();
        HashMap<String,Object> map = new HashMap<String,Object>();
        if(result.isEmpty()){
            
        }else{
            map = result.get(0);
            request.setAttribute("map", map);
        }
        return "success";
    }

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }
    
}
